<template>
  <el-form label-postion="left" ref="form" size="mini" label-width="80px" class="base-attrbute">
    <el-form-item label="表格模式：">
      <el-radio-group v-model="value.model">
        <el-radio-button label="input">带边框</el-radio-button>
        <el-radio-button label="popover">无边框</el-radio-button>
      </el-radio-group>
    </el-form-item>
    <el-form-item label="表格多选：">
      <el-radio-group v-model="value.selection">
        <el-radio :label="true">开启</el-radio>
        <el-radio :label="false">关闭</el-radio>
      </el-radio-group>
    </el-form-item>
    <el-form-item label="表格列数：">
      <el-input-number v-model="num" label="描述文字"></el-input-number>
    </el-form-item>
  </el-form>
</template>
<script type="text/javascript">
// import empty from './empty.vue'
export default {
  props:{
    value:[Object,Array],
  },
  components: {
    //empty
  },
  data() {
    return {

    }
  },
  /**
   * 计算属性
   * @type {Object}
   */
  computed: {
    num:{
      get(){
        return this.value.header.length;
      },
      set(val){
        var header = {
          label:"",
          field:"",
          width:0,
        }
        let onNum = this.value.header.length;
        let differ = val - onNum;
        if (differ == -1) {
          this.value.header.pop();
        }
        if (differ == 1) {
          this.value.header.push(header);
        }
      }
      
    }
  },
  /**
   * 数据监听
   * @type {Object}
   */
  watch: {

  },
  /**
   * 页面加载执行
   * @return {[type]} [description]
   */
  mounted() {

  },
  /**
   * 页面方法
   * @type {Object}
   */
  methods: {

  }
}

</script>
<style type="text/css" lang="scss">
.base-attrbute{
  padding: 10px;
  .el-form-item--mini.el-form-item,
  .el-form-item--small.el-form-item {
    margin-bottom: 10px;
  }
  .el-form-item__label{
    text-align: right;
  }

  .el-form--label-top .el-form-item__label {
    float: none;
    display: inline-block;
    text-align: left;
    padding: 0;
  }
  .el-form-item__label,.el-form-item__content{
    font-size: 12px !important;
  }
}

</style>
